Conventionally, there are games in which a rod-like object such as a golf club, a baseball bat or the like is swung (a golf game or a baseball game). In such a game, a button using a switch or a lever is used as a controller for inputting a motion of swinging the rod-like object. Separately from such a game, a rod-shaped controller (input control device) is disclosed (for example, Japanese Laid-Open Patent Publication No. 2000-308756; hereinafter, referred to as “patent document 1”). The controller described in patent document 1 includes an acceleration sensor. A player holds the rod-shaped controller in his/her hand and actually performs a motion of swinging the controller. In the case of, for example, a three-dimensional game in which the player can experience a sword fighting action play, the player performs a motion of swinging the controller as if swinging a sword. Based on data which is output from the acceleration sensor, movement data of the sword in the game space is obtained, and a motion of a player object swinging the sword in accordance with the motion of the player is displayed as a game image.
However, the above-described input control device disclosed in patent document 1 has the following problem. When, for example, the player swings the rod-shaped controller vigorously, the detection speed of the acceleration sensor does not follow the moving speed of the controller. As a result, motion data representing a motion different from the motion provided by the operation of the player is occasionally obtained. The motion intended by the player is not displayed; i.e., a motion which is quite different from the motion of the controller provided by the operation of the player is displayed without reflecting the intention of the player. This makes the game less amusing.
Therefore, certain example embodiments provide a game program and a game apparatus for reflecting a motion intended by the player even when an input device is vigorously moved.
Certain example embodiments may have the following features to attain the object mentioned above. The reference numerals, additional explanations and the like in parentheses in this section of the specification indicate the correspondence with the embodiments described later for easier understanding of the present invention, and do not limit the present invention in any way.
Certain example embodiments are used for a game which causes the player to perform an operation of changing the inclination of an input device with respect to the gravity direction and executes game control in accordance with the inclination. Typically, it is instructed explicitly or inexplicitly by an operation manual or on the screen to perform such an operation, and the player follows such an instruction.
A first aspect of certain example embodiments is directed to a storage medium having stored thereon a game program executable by a computer of a game apparatus capable of using a value detected by an acceleration detection section provided in an input device for detecting an acceleration in at least two directions. The game program causes the computer to execute a first acceleration obtaining step (S2), a second acceleration obtaining step (S2), a first determination step (S6), a first parameter setting step (S14), and a game processing control step (S16). The first acceleration obtaining step (S2) obtains first acceleration data representing an acceleration in a first direction of the input device, based on a value detected by the acceleration detection section. The second acceleration obtaining step (S2) obtains second acceleration data representing an acceleration in a second direction of the input device which is different from the first direction, based on a value detected by the acceleration detection section. The first determination step (S6) determines whether or not the first acceleration data is smaller than a first threshold value. The first parameter setting step (S14), when the first acceleration data is determined to be smaller than the first threshold value in the first determination step, executes predetermined calculation processing at least based on the second acceleration data to execute first setting processing of calculating a first parameter used in game processing; and when the first acceleration data is determined to be larger than the first threshold value in the first determination step, executes second setting processing of setting the first parameter to a predetermined value. The game processing control step (S16) executes the game processing based on the first parameter which is set in the first parameter setting step.
The acceleration detection section detects an acceleration in at least two directions. The acceleration detection section is provided in the input device and thus detects an acceleration generated in at least two directions of the input device. The acceleration detection section may be capable of detecting an acceleration in three directions. The input device is typically formed such that the player can hold the input device with both hands or one hand. The acceleration detection section may include a single acceleration sensor or include a plurality of acceleration sensors. The first acceleration obtaining step obtains acceleration data representing an acceleration generated in one direction (first direction) of the input device, based on a value detected by the acceleration detection section. The second acceleration obtaining step obtains acceleration data representing an acceleration generated in another direction (second direction) of the input device, based on a value detected by the acceleration detection section. The first direction and the second direction may be the same, or different from, a direction in which the acceleration detection section detects the acceleration.
The first direction and the second direction may be perpendicular to each other. For example, each of the first direction and the second direction is typically one of the forward direction (positive z axis direction in FIG. 3 described later), the rearward direction (negative z axis direction in FIG. 3), the upward direction (positive y axis direction in FIG. 3), the downward direction (negative y axis direction in FIG. 3), the leftward direction (positive x axis direction in FIG. 3), and the rightward direction (negative x axis direction in FIG. 3). The first direction and the second direction may be one of the following combinations: (a) “the first direction is the forward or rearward direction, and the second direction is the upward or downward direction”, (b) “the first direction is the upward or downward direction, and the second direction is the forward or rearward direction”, (c) “the first direction is the leftward or rightward direction, and the second direction is the upward or downward direction”, and (d) “the first direction is the upward or downward direction, and the second direction is the leftward or rightward direction”. In a game in which the player holding the input device performs an inclination operation by moving one of the front end and the rear end upward and downward without moving the other end, the combination (a) is preferable. In a game in which the player holding the input device performs an inclination operation by moving one of the top end and the bottom end forward and rearward without moving the other end, the combination (b) is preferable. In a game in which the player holding the input device performs an inclination operation by moving one of the left end and the right end upward and downward without moving the other end, the combination (c) is preferable. In a game in which the player holding the input device performs an inclination operation by moving one of the top end and the bottom end leftward and rightward without moving the other end, the combination (d) is preferable. Owing to such setting, the first direction is a direction in which a centrifugal force acts when the player moves one end of the input device upward and downward, forward and rearward, or leftward and rightward without moving the other end. Thus, in the first determination step described later, the magnitude of the acceleration including the centrifugal force generated in the input device can be determined. The forward-rearward direction, the upward-downward direction, and leftward-rightward direction of the input device are three directions perpendicular to one another. Which directions are the forward-rearward direction, the upward-downward direction, and leftward-rightward direction is determined in a state where the player holds the input device at a reference posture. Usually, these directions are specified in accordance with the shape of the housing of the input device. One of the three directions can be specified as a longer direction of the input device, and the other two directions can be specified as shorter directions of the input device. Hereinafter, a simple expression “forward-rearward direction” refers to the forward-rearward direction of the input device. A simple expression “upward-downward direction” refers to the upward-downward direction of the input device. A simple expression “leftward-rightward direction” refers to the leftward-rightward direction of the input device.
When the input device is formed to have a lengthy shape, the longer direction may be the first direction and the shorter direction may be the second direction. The input device may be formed such that the input device extends in the longer direction and the input device is held by a hand which is in contact with the circumferential surface thereof around the axis extending in the longer direction. In this case, the longer direction may be the first direction and a direction perpendicular thereto may be the second direction. As described above, certain example embodiments are used for a game which causes the player to perform an operation of changing the inclination of the input device with respect to the gravity direction. More specifically, the player holds the input device such that the first direction and the second direction are both present in the vertical plane, and performs an operation of inclining the input device while keeping the state where the first direction and the second direction are both present in the vertical plane. Typically, it is instructed explicitly or inexplicitly to perform such an operation by an operation manual or on the screen, and the player follows such an instruction. The first determination step determines which of the acceleration generated in the first direction of the input device and a certain threshold value is larger, based on the first acceleration data obtained in the first acceleration obtaining step. When the player performs an operation of inclining the input device, one end of the input device moves on an arc around the other end as the center. Therefore, the acceleration detection section of the input device moves in an arc. As described above, the player holds the input device such that the first direction and the second direction are both in the vertical plane, and performs an operation of inclining the input device while keeping such a state. Therefore, in the first direction and the second direction, an acceleration by the movement on an arc (a centrifugal force acting in a direction which is perpendicular to the arc and is outward from the arc and an acceleration acting in a direction along the arc) is generated. When the input device is further inclined, the inclination of the first direction and the second direction with respect to the gravity direction changes, and therefore a first direction component and a second direction component of the gravitational acceleration change. Namely, by the operation of inclining the input device, the first acceleration data is changed by the “acceleration by the movement on an arc” and “the first direction component of the gravitational acceleration”. The gravity component may be removed from the first acceleration data obtained in the first acceleration obtaining step, so that it is determined in the first determination step which of the first acceleration data after the gravity component is removed and the first threshold value is larger. (In the second determination step described later also, it may be determined which of the second acceleration data after the gravity component is removed and the second threshold value is larger.) When the gravity component is not removed from the first acceleration data, the determination may be performed in accordance with the maximum value of the first direction component of the gravitational acceleration. The maximum value is maximum when the first direction matches the gravity direction, and is the gravitational acceleration. When the range in which the input device can be inclined is limited, the maximum value is “the first direction component of the gravitational acceleration at a posture at which the first direction is closest to the gravity direction”. (The limitation on the range in which the input device can be inclined is instructed explicitly or inexplicitly by an operation manual or on the screen, and the player follows such an instruction.) In a game in which the input device is inclined from the state where the first direction is the upward vertical direction to the state where the first direction is the horizontal direction, the first direction component of the gravitational acceleration has a value in the range of −G to 0. Therefore, the maximum value is 0. Hence, the first threshold value is set to a value larger than 0. In a game in which the input device is inclined from the state where the first direction is the downward vertical direction to the state where the first direction is the horizontal direction, the first direction component of the gravitational acceleration has a value in the range of 0 to G. Therefore, the maximum value is G. Hence, the first threshold value is set to a value larger than G. In a game in which the input device is inclined from the state where the first direction is the upward vertical direction to the state where the first direction is the downward vertical direction, the first direction component of the gravitational acceleration has a value in the range of −G to G. Therefore, the maximum value is G. Hence, the first threshold value is set to a value larger than G. Also in a game in which the input device is allowed to be inclined from a state where the first direction has a predetermined angle (e.g., 45 degrees or 30 degrees) with respect to the horizontal plane to a state where the first direction has another predetermined angle with respect to the horizontal plane, the first threshold value can be determined in a similar manner. When the first acceleration data is larger than the maximum value, this means that the first acceleration data includes at least an element of the “acceleration by the movement on an arc”. The “threshold value” used in the first determination step is set to be a value larger than the maximum value (a value obtained by adding a certain determination value to the maximum value). Owing to this, in the first determination step, it is determined that the value of the “acceleration by the movement on an arc” included in the first acceleration data is at least larger than the certain determination value. The value of the “acceleration by the movement on an arc” increases in accordance with the level of vigor with which the player inclines the input device. Therefore, in the first determination step, it is determined whether or not the player performs the operation of inclining the input device with a certain level of vigor. At least when the first acceleration data is determined to be smaller than the threshold value in the first determination step, the first parameter setting step sets the first parameter based on at least the acceleration applied in the second direction (second acceleration data). When the first acceleration data is determined to be larger than the threshold value, the first parameter setting step sets the first parameter to a predetermine value. Owing to this, only when the player does not perform the operation of inclining the input device with a certain level of vigor, the first parameter is set based on the second acceleration data. Otherwise, the first parameter is set to a predetermined value. In the following description, the determination that the first acceleration data is smaller than the threshold value will be referred to as the “normal operation determination”, and the determination that the first acceleration data is larger than the threshold value will be referred to as the “vigorous operation determination”.
The player holds the input device such that the first direction and the second direction are both present in the vertical plane, and performs the operation of inclining the input device while keeping such a state. Therefore, it can be determined that when the value of the “acceleration by the movement on an arc” included in the first acceleration data is increased by making the operation of inclining the input device performed by the player more vigorous, the value of the “acceleration by the movement on an arc” included in the second acceleration data is increased. Namely, it can be determined that the second acceleration data also includes a large “acceleration by the movement on an arc” in addition to a second direction component of the gravitational acceleration. In such a case, the first parameter setting step stops setting the first parameter based on the second acceleration data, and sets the first parameter to a predetermined value. Owing to this, the first parameter is guaranteed, to a certain degree, to be a parameter in accordance with the second direction component of the gravitational acceleration. The second component of the gravitational acceleration changes by the inclination of the input device. Therefore, it is guaranteed, to a certain degree, that the first parameter can be set in accordance with the inclination of the input device.
In the first parameter setting step, the second acceleration data may be set as the first parameter, or the first parameter may be set by executing predetermined calculation processing on the second acceleration data. (This is applied to the case where it is described below that “the first parameter is set based on certain data”). In the latter case, the specific content of the calculation processing is arbitrary. Calculation processing by which when the second acceleration data is increased, the first parameter increases or decreases in one way may be used. (In this case, when the second acceleration data is equal to or larger than a certain value or equal to or smaller than the certain value, the first parameter may be set to be the certain value; this is applied to the case where it is described below as “increasing or decreasing in one way”.)
The first parameter setting step may set the first parameter based on both the first acceleration data and the second acceleration data when the normal operation determination is made in the first determination step. In this case, for example, inclination data which represents the inclination of the input device with respect to the vertical direction may be calculated based on the first acceleration data and the second acceleration data, and the first parameter may be set based on the inclination data. For this setting, calculation processing by which when the inclination data increases, the first parameter increases or decreases in one way may be used. For example, when the first direction and the second direction are perpendicular to each other, the first acceleration data and the second acceleration data may be substituted for an inverse tangent function, so that angle data, which is inclination data, can be calculated and set as the first parameter.
The first determination step determines which of the first acceleration data and the first threshold value is larger. Further in the second determination step, it may be determined which of the second acceleration data and the second threshold value is larger. As described above, the first threshold value is obtained by adding a predetermined determination value to the maximum value in the first direction component of the gravitational acceleration. Similarly, the second threshold value is obtained by adding a predetermined determination value to the maximum value in the second direction component of the gravitational acceleration. The first parameter setting step may set the first parameter to a predetermined value when the first acceleration data is determined to be larger than the first threshold value in the first determination step and further the second acceleration data is determined to be larger than the second threshold value in the second determination step, and may otherwise set the first parameter based on at least the second acceleration data. Owing to this, the level of vigor at which the input device is operated to be inclined can be accurately determined. The first direction may be a direction which, when the player performs the operation of inclining the input device, perpendicularly crosses an arc which is a trajectory of a movement of a predetermined position in the input device made by the operation. The second direction may be a direction which, when the player performs the operation of inclining the input device, is a tangent direction to the arc. In this case, when the player performs the operation of inclining the input device, a centrifugal force is generated in the first direction, and an acceleration by the force of the operation is generated in the second direction. When the player performs the operation of inclining the input device, the acceleration by the force of the operation is first generated, and the centrifugal force is generated with a delay. Therefore, the determination in the first determination step that the first acceleration data is larger than the first threshold value is made after the determination in the second determination step that the second acceleration data is larger than the second threshold value. Thus, the history of the second acceleration may be stored, so that it can be determined that the maximum value of the second acceleration data obtained in an immediately previous predetermined period is larger than the second threshold value.
In the case where the acceleration detection section is a three-axial acceleration sensor, a third acceleration obtaining step of obtaining third acceleration data representing an acceleration applied in a third direction of the input device (different from the first direction and also the second direction; preferably perpendicularly crossing the first direction and also the second direction) based on a value detected by the acceleration detection section may be executed. In this case, when the normal operation determination is made, the first parameter setting step may set the first parameter based on the first acceleration data, the second acceleration data and the third acceleration data. When the first acceleration data matches the threshold value, the first parameter setting step performs processing in accordance with the normal operation determination or the vigorous operation determination, needless to say. When the normal operation determination is made, the first parameter setting step sets the first parameter based on at least the second acceleration data. At this point, the value of the first parameter may be limited to a predetermined range. (Only an upper limit, only a lower limit, or both the upper limit and the lower limit may be set.) Specifically, when the first parameter which is calculated by executing predetermined processing based on at least the second acceleration data is outside a predetermined range, the first parameter may be set to a border value (the upper limit or the lower limit) of the predetermined range. When the vigorous operation determination is made, the first parameter setting step sets the first parameter to a predetermined value. This predetermined value may be either a border value (the upper limit or the lower limit) of the predetermined range, a value larger than the upper limit, or a value smaller than the lower limit. Namely, where the first parameter can be set to a value in the range of p1 to p2 based on the second acceleration data when the normal operation determination is made, the first parameter may be set to either p1, a value smaller than p1, p2, or a value larger than p2 when the vigorous operation determination is made. When the normal operation determination is made, the first parameter setting step executes calculation processing by which the first parameter calculated when the second acceleration data is a1 to a2 (a1<a2) is p1 to p2 (p1<p2). Such calculation processing may be either (a) or (b) below.
(a) Calculation processing by which the second acceleration data a1 corresponds to the first parameter p1, the second acceleration data a2 corresponds to the first parameter p2, and the first parameter increases as the second acceleration data increases.
(b) Calculation processing by which the second acceleration data a1 corresponds to the first parameter p2, the second acceleration data a2 corresponds to the first parameter p1, and the first parameter decreases as the second acceleration data increases.
When processing (a) is executed and the vigorous operation determination is made in the first determination step and the second determination step, the first parameter may be set to p2 or a predetermined value larger than p2. When processing (b) is executed, the second determination step is executed, and the vigorous operation determination is made in the first determination step and the second determination step, the first parameter may be set to p1 or a predetermined value smaller than p1.
Hereinafter, a typical example will be described. The first direction is the forward direction, and the second direction is the upward direction. When the normal operation determination is made, the first parameter setting section substitutes the first acceleration data and the second acceleration data for an inverse tangent function to calculate angle data θc (data representing the inclination of the input device). Based on the angle data θc, “data θo representing the magnitude of the inclination of the game object” as the first parameter is set. Typically, the data θo is data representing the magnitude of the inclination with respect to the virtual vertical direction in the virtual space (hereinafter, referred to simply as the “inclination data”). As described below, the data θo may be target inclination data for the game object. Based on the data θo, the processing of displaying the game object is executed. In this manner, the game object can be displayed as being inclined in the virtual space by inclining the input device. The angle data θc may be used as the data θo, or data θo is obtained by executing predetermined calculation on the angle data θc. In the latter case, the data θo may be obtained by adding a predetermined value to, or subtracting a predetermined value from, the angle data θc. Alternatively, the data θo may be obtained by multiplying the angle data θc by a predetermined value. The data θo may be obtained by inverting the sign (positive or negative) of the angle data θc. In this case, the data θo may be set to decrease as the angle data θc increases. In the following example, the data θo increases as the angle data θc increases. Also in the following example, the data θc represents an angle with respect to the horizontal plane with an angle in the upward direction having a positive value, and the data θo represents an angle with respect to the virtual horizontal plane (the horizontal plane in the virtual space) with an angle in the virtual upward direction (the upward vertical direction in the virtual space) having a positive value. As can be appreciated by those skilled in the art, what the angle data θc and the data θo are based on, or the direction of positive or negative values is not limited to such setting. When data calculated when the normal operation determination is made is equal to or less than θc1, the inclination data of the game object is set to θo1. When the vigorous operation determination is made, the inclination data of the game object is set to θo1 or a value smaller than θo1. When the first acceleration data is determined to be larger than the first threshold value in the first determination step and further the second acceleration data is determined to be larger than the second threshold value in the second determination step, the inclination data of the game object is set to θo1 or a value smaller than θo1.
In a second aspect based on the first aspect, the game causes a player to perform an operation of inclining the input device. The first direction is a direction in which, when the player performs the operation of inclining the input device, a centrifugal force is generated. The second direction is a direction in which, when the player performs the operation of inclining the input device, an acceleration is generated by a force of the operation.
In a third aspect based on the first aspect, the game causes a player to perform an operation of inclining the input device. The first direction is a direction which, when the player performs the operation of inclining the input device, perpendicularly crosses an arc which is a trajectory of a movement of a predetermined position in the input device made by the operation. The second direction is a direction which, when the player performs the operation of inclining the input device, is a tangent direction to the arc.
In a fourth aspect based on the first aspect, the first setting processing sets the first parameter to a predetermined value when a value calculated by the predetermined calculation processing based on the second acceleration data is outside a predetermined range. The second setting processing sets the first parameter to a border value of the predetermined range or a predetermined value outside the predetermined range.
In a fifth aspect based on the fourth aspect, the predetermined calculation processing causes the first parameter to change in one way in accordance with an increase in the second acceleration data.
In a sixth aspect based on the first aspect, the game causes a player to perform an operation of inclining the input device so as to keep the first direction and the second direction to be present in a vertical plane and so as to cause an inclination of the first direction with respect to a gravity direction is in a predetermined range. The first threshold value is larger than a maximum value of a gravitational acceleration generated in the first direction when the input device is inclined within the predetermined range.
In a seventh aspect based on the first aspect, the game program causes the computer to further execute a removing step of removing a gravity component applied in the first direction from the first acceleration data obtained in the first acceleration obtaining step. The first determination step determines whether or not the first acceleration data after the gravity component is removed in the removing step is smaller than the first threshold value.
In an eighth aspect based on the seventh aspect, the game program causes the computer to further execute a difference calculation step (S9), a determination step and a storage step. The difference calculation step calculates difference data between the first acceleration data of the current time which is obtained in the first acceleration obtaining step and the first acceleration data of the immediately previous time, and/or difference data between the second acceleration data of the current time which is obtained in the second acceleration obtaining step and the second acceleration data of the immediately previous time. The determination step determines whether or not the difference data calculated in the difference calculation step is smaller than a threshold value. The storage step, at least when the difference data is determined to be smaller than the threshold value in the determination step, stores the first acceleration data of the current time obtained in the first acceleration obtaining step. The removing step subtracts data stored in the storage step from the first acceleration data of the current time obtained in the first acceleration obtaining step.
In a ninth aspect based on the first aspect, the first setting processing calculates angle data representing an angle of the input device with respect to a gravity direction based on at least the second acceleration data, sets the first parameter based on the angle data, and when the angle data represents an angle outside a predetermined range, sets the first parameter to a predetermined value. The first threshold value is larger than a maximum value of a gravitational acceleration generated in the first direction when the input device is inclined within the predetermined range, in the predetermined calculation processing.
In a tenth aspect based on the first aspect, the game program causes the computer to further execute a second determination step of determining whether the second acceleration data is smaller than a second threshold value. The first parameter setting step executes the second setting processing when the first acceleration data is determined to be larger than the first threshold value in the first determination step and further the second acceleration data is determined to be larger than the second threshold value in the second determination step.
In an eleventh aspect based on the tenth aspect, the game causes a player to perform an operation of inclining the input device so as to keep the first direction and the second direction to be present in a vertical plane and so as to cause an inclination of the first direction with respect to a gravity direction is in a predetermined range. The second threshold value is larger than a maximum value of a gravitational acceleration generated in the second direction when the input device is inclined within the predetermined range.
In a twelfth aspect based on the tenth aspect, the predetermined calculation processing causes the first parameter to increase in one way in accordance with an increase in the second acceleration data. The first setting processing sets the first parameter to a predetermined value when a value calculated by the predetermined calculation processing based on the second acceleration data is larger than a predetermined value. The second setting processing sets the first parameter to the predetermined value or another predetermined value larger than the predetermined value.
In a thirteenth aspect based on the tenth aspect, the predetermined calculation processing causes the first parameter to decrease in one way in accordance with an increase in the second acceleration data. The first setting processing sets the first parameter to a predetermined value when a value calculated by the predetermined calculation processing based on the second acceleration data is smaller than a predetermined value. The second setting processing sets the first parameter to the predetermined value or another predetermined value smaller than the predetermined value.
In a fourteenth aspect based on the first aspect, the first setting processing calculates the first parameter by executing predetermined calculation processing based on at least the first acceleration data and the second acceleration data.
In a fifteenth aspect based on the fourteenth aspect, the predetermined calculation processing calculates angle data representing an angle of the input device with respect to a gravity direction as the first parameter based on at least the first acceleration data and the second acceleration data.
In a sixteenth aspect based on the fifteenth aspect, the predetermined calculation processing substitutes the first acceleration data and the second acceleration data for an inverse tangent function.
In a seventeenth aspect based on the fourteenth aspect, the first setting processing sets the first parameter to a predetermined value when a value calculated by the predetermined calculation processing based on the first acceleration data and the second acceleration data is outside a predetermined range. The second setting processing sets the first parameter to a border value of the predetermined range or a predetermined value outside the predetermined range.
In an eighteenth aspect based on the fifteenth aspect, the first setting processing sets the first parameter to a predetermined angle when the calculated angle data is outside a predetermined range. The second setting processing sets the first parameter to a border angle of the predetermined range or a predetermined angle outside the predetermined range. The first threshold value is larger than a maximum value of a component of the first direction of the gravitational acceleration at an angle of the input device with respect to a gravity direction, the angle being included in the predetermined range.
In a nineteenth aspect based on the tenth aspect, the game program causes the computer to further execute a history storage step of storing a history of the second acceleration data obtained in the second acceleration obtaining step on a storage section accessible by the computer. The second determination step refers to the history stored on the storage section to at least determine whether or not maximum data of the second acceleration data in an immediately previous predetermined period is larger than the second threshold value. The first parameter setting step executes the second setting processing when the first acceleration data is determined to be larger than the first threshold value in the first determination step and further the maximum data is determined to be larger than the second threshold value in the second determination step.
A twentieth aspect according certain example embodiments is directed to a storage medium having stored thereon a game program executable by a computer of a game apparatus capable of using a value detected by an acceleration detection section provided in an input device for detecting an acceleration in at least two directions. The game causes a player to perform an operation of inclining the input device. The game program causes the computer to execute a first acceleration obtaining step (S2), a second acceleration obtaining step (S2), a first determination step (S6), a game input data setting step (S14), and a game processing control step (S16). The first acceleration obtaining step, when the player performs the operation of inclining the input device, obtains first acceleration data representing an acceleration in a direction perpendicularly crossing an arc which is a trajectory of a movement of a predetermined position in the input device made by the operation, based on a value detected by the acceleration detection section. The second acceleration obtaining step obtains second acceleration data representing an acceleration in a tangent direction to the arc when the player performs the operation of inclining the input device, based on a value detected by the acceleration detection section. The first determination step determines whether or not the first acceleration data is smaller than a first threshold value. The game input data setting step, when the first acceleration data is determined to be smaller than the first threshold value in the first determination step, substitutes the first acceleration data and the second acceleration data to calculate inclination data representing an inclination of the input device with respect to a gravity direction and to set the inclination data as a first parameter used in game processing; and at least when the first acceleration data is determined to be larger than the first threshold value in the first determination step, sets the first parameter to a predetermined value. The game processing control step executes the game processing based on the first parameter which is set in the game input data setting step.
A twenty-first aspect of certain example embodiments is directed to a storage medium having stored thereon a game program executable by a computer of a game apparatus capable of using a value detected by an acceleration detection section provided in an input device for detecting an acceleration in at least two directions. The game program causes the computer to execute a first acceleration obtaining step (S2), a second acceleration obtaining step (S2), a history storage step, a first determination step, a second determination step, and a game processing control step (S16). The first acceleration obtaining step obtains first acceleration data representing an acceleration applied in a first direction of the input device, based on a value detected by the acceleration detection section. The second acceleration obtaining step obtains second acceleration data representing an acceleration applied in a second direction of the input device which is different from the first direction, based on a value detected by the acceleration detection section. The history storage step stores a history of the second acceleration data obtained in the second acceleration obtaining step on a storage section accessible by the computer. The first determination step determines whether or not the first acceleration data is smaller than a first threshold value. The second determination step refers to the history stored on the storage section to at least determine whether or not maximum data of the second acceleration data in an immediately previous predetermined period is larger than the second threshold value. The game processing control step executes predetermined game processing when the first acceleration data is determined to be larger than the first threshold value in the first determination step and further the maximum data is determined to be larger than the second threshold value in the second determination step.
A twenty-second aspect of certain example embodiments is directed to a game apparatus capable of using a value detected by an acceleration detection section provided in an input device for detecting an acceleration in at least two directions. The game apparatus comprises a first acceleration obtaining section (6, 30), a second acceleration obtaining section (6, 30), a first determination section (30), a first parameter setting section (30), and a game processing control section (30). The first acceleration obtaining section obtains first acceleration data representing an acceleration applied in a first direction of the input device, based on a value detected by the acceleration detection section. The second acceleration obtaining section obtains second acceleration data representing an acceleration applied in a second direction of the input device which is different from the first direction, based on a value detected by the acceleration detection section. The first determination section determines whether or not the first acceleration data is smaller than a first threshold value. The first parameter setting section, when the first acceleration data is determined to be smaller than the first threshold value by the first determination section, executes predetermined calculation processing at least based on the second acceleration data to execute first setting processing of calculating a first parameter used in game processing; and when the first acceleration data is determined to be larger than the first threshold value by the first determination section, executes second setting processing of setting the first parameter to a predetermined value. The game processing control section executes the game processing based on the first parameter which is set by the first parameter setting section.
A twenty-third aspect of certain example embodiments is directed to a game apparatus capable of using a value detected by an acceleration detection section provided in an input device for detecting an acceleration in at least two directions. A game executable by the game apparatus causes a player to perform an operation of inclining the input device. The game apparatus comprises a first acceleration obtaining section (6, 30), a second acceleration obtaining section (6, 30), a first determination section (30), a game input data setting section (30), and a game processing control section (30). The first acceleration obtaining section, when the player performs the operation of inclining the input device, obtains first acceleration data representing an acceleration applied in a direction perpendicularly crossing an arc which is a trajectory of a movement of a predetermined position in the input device made by the operation, based on a value detected by the acceleration detection section. The second acceleration obtaining section obtains second acceleration data representing an acceleration applied in a tangent direction to the arc when the player performs the operation of inclining the input device, based on a value detected by the acceleration detection section. The first determination section determines whether or not the first acceleration data is smaller than a first threshold value. The game input data setting section, when the first acceleration data is determined to be smaller than the first threshold value by the first determination section, substitutes the first acceleration data and the second acceleration data for an inverse tangent function to calculate inclination data representing an inclination of the input device with respect to a gravity direction and to set the inclination data as a first parameter used in game processing; and when the first acceleration data is determined to be larger than the first threshold value by the first determination section, sets the first parameter to a predetermined value. The game processing control section executes the game processing based on the first parameter which is set by the game input data setting section.
A twenty-fourth aspect of certain example embodiments is directed to a game apparatus capable of using a value detected by an acceleration detection section provided in an input device for detecting an acceleration in at least two directions. The game apparatus comprises a first acceleration obtaining section (6, 30), a second acceleration obtaining section (6, 30), a history storage section (33), a first determination section (30), a second determination section (30), and a game processing section (30). The first acceleration obtaining section obtains first acceleration data representing an acceleration applied in a first direction of the input device, based on a value detected by the acceleration detection section. The second acceleration obtaining section obtains second acceleration data representing an acceleration applied in a second direction of the input device which is different from the first direction, based on a value detected by the acceleration detection section. The history storage section stores a history of the second acceleration data obtained by the second acceleration obtaining section on a storage section. The first determination section determines whether or not the first acceleration data is smaller than a first threshold value. The second determination section refers to the history stored on the storage section to at least determine whether or not maximum data of the second acceleration data in an immediately previous predetermined period is larger than the second threshold value. The game processing section executes predetermined game processing when the first acceleration data is determined to be larger than the first threshold value by the first determination section and further the maximum data is determined to be larger than the second threshold value by the second determination section.
According to the first aspect, when the vigor with which the input device is moved exceeds a certain level, the calculation processing on the game parameter based on a detected acceleration value is stopped. Therefore, even when the input device is vigorously moved, data which is not intended by the player can be prevented from being input.
According to the second through fifth aspects, substantially the same effect as that of the first aspect is provided. Especially when the input device is swung, the motion intended by the player can be reflected on the game processing more accurately.
According to the sixth through eleventh aspects, especially regarding the operation of swinging up or swinging down the input device, the motion intended by the player can be reflected on the game processing more accurately.
According to the twelfth and thirteenth aspects, substantially the same effect as that of the first aspect is provided.
According to the fourteenth through seventeenth aspects, the operation of moving the input device can be detected more accurately and reflected on the game processing.
According to the eighteenth aspect, the intention of the player can be more easily reflected on the game processing by correcting the angle. Thus, the operability of the input device can be improved.
According to the nineteenth aspect, the comparison is made with the immediately previous acceleration data. Therefore, the operation of moving the input device in an accelerating manner can be detected more accurately.
According to the twentieth and twenty-first aspects, substantially the same effect as that of the first aspect is provided.
A game apparatus according to certain example embodiments provides substantially the same effect as that of the above-described game program according to certain example embodiments.
These and other objects, features, aspects and advantages of certain example embodiments will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.